load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
    name = "plan_cache_lib",
    srcs = ["plan_clone_generator.go"],
    importpath = "github.com/pingcap/tidb/pkg/planner/core/generator/plan_cache",
    visibility = ["//visibility:private"],
    deps = ["//pkg/planner/core"],
)

go_binary(
    name = "plan_cache",
    embed = [":plan_cache_lib"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "plan_cache_test",
    timeout = "short",
    srcs = ["plan_clone_test.go"],
    data = [
        "//pkg/planner/core:generator_files",
    ],
    embed = [":plan_cache_lib"],
    flaky = True,
)
